package thread.java20230106;

public class Demo42 {
    public static void main(String[] args) {
        MyTimer myTimer = new MyTimer();
        myTimer.schedule(new MyTask(()->{
            System.out.println("执行任务1");
        },5000));

        myTimer.schedule(new MyTask(()->{
            System.out.println("执行任务2");
        },1000));

        myTimer.schedule(new MyTask(()->{
            System.out.println("执行任务3");
        },3000));
    }
}
